package com.jackchong.net

import java.io.Serializable

/**
 * author : chong.huang
* create : 2/14/21
 * desc   :
 */
interface Cache {

    companion object {
        fun obtain(mode: CacheStrategy, hashCode: Int): Cache = CommonCache(mode, hashCode)
    }

    fun read(block: (Serializable) -> Unit)

    fun write(any: Any?)

    fun cancel()

}